<template>
  <el-dialog :title="title" :close-on-click-modal="false" :fullscreen="true" :visible.sync="visible"
    :before-close="cancel" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="50%">
    <el-row class="JNPF-common-search-box" :gutter="16">
      <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
        <el-col :span="8">
          <el-form-item label="对象类型" prop="FBILLNAME">
            <el-input v-model="dataForm.FBILLNAME"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="对象名称" prop="FBILLNO">
            <el-input v-model="dataForm.FBILLNO"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="5">
          <el-form-item label="">
            <!-- <el-button type="success" icon="el-icon-plus" @click="insert">添加一行</el-button> -->
            <el-button type="primary" :loading="loading">返回</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>

    <el-table :data="list" border stripe>
      <!-- <el-table-column label="操作" width="80">
        <template slot-scope="scope">
          <el-button slot="reference" icon="el-icon-delete" style="color: red" @click="shopdate(scope.$index)"
            type="text">删除</el-button>
        </template>
      </el-table-column> -->
      <el-table-column prop="FBILLNO" label="日期" width="95"></el-table-column>
      <el-table-column prop="FWEEK" label="星期" width="65"></el-table-column>
      <el-table-column prop="FTIME" label="时间" width="95"></el-table-column>
      <el-table-column prop="FPOINT" label="场地名称"></el-table-column>
      <el-table-column prop="FTEACH" label="授课教师" width="95"></el-table-column>
      <el-table-column prop="FBILLNAME" label="课程名称"></el-table-column>
      <el-table-column prop="FBRAND" label="课节名称" width="85"></el-table-column>
      <el-table-column prop="FSTATENAME" label="考勤状态" ></el-table-column>
    </el-table>
    <StudqueryFcuston ref="StudqueryFcuston" @confirm="shoplist" />
  </el-dialog>
</template>
<script>
  import StudqueryFcuston from "@/components/StudqueryFcuston/StudqueryFcuston.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    components: { StudqueryFcuston },
    props: {
      formationlist: {
        type: Array,
        default: [],
      },
    },
    data() {
      return {
        title: "新增",
        insertorupdate: true,
        dataForm: {
          FBILLNAME: "学生",
          FBILLNO: "刘备",
        },
        rules: {
          FBILLNO: [
            { required: true, message: '请输入课程编号', trigger: 'blur' },
          ],
          FBILLNAME: [
            { required: true, message: '请输入课程名称', trigger: 'blur' },
          ],
        },
        list: [{
            "FBILLNAME": "综合化学实验1",
            "FPOINT":"奉1教楼101",
            "FBILLNO": "2024-11-25",
            "FTIME":"09:00~11:00",
            "FWEEK": "周一",
            "FBRAND": "第一节",
            "FBEGTIME": "09:00",
            "FENDTIME": "10:30",
            "FTEACH": "秦始皇",
            "FBILLSTATE": "已结束",
            "FSTATENAME": "正常"
            },{
            "FBILLNAME": "化工基础实验",
            "FPOINT":"奉1教楼201",
            "FBILLNO": "2024-11-25",
            "FTIME":"10:40~11:50",
            "FWEEK": "周一",
            "FBRAND": "第二节",
            "FBEGTIME": "10:40",
            "FENDTIME": "11:50",
            "FTEACH": "汉武帝",
            "FBILLSTATE": "已结束",
            "FSTATENAME": "请假"
            },
            ,{
            "FBILLNAME": "仪器分析实验",
            "FPOINT":"奉1教楼201",
            "FBILLNO": "2024-11-25",
            "FTIME":"13:30~15:00",
            "FWEEK": "周一",
            "FBRAND": "第三节",
            "FBEGTIME": "13:30",
            "FENDTIME": "15:00",
            "FTEACH": "唐太宗",
            "FBILLSTATE": "已结束",
            "FSTATENAME": "正常"
            },{
            "FBILLNAME": "综合化学实验2",
            "FPOINT":"奉1教楼101",
            "FBILLNO": "2024-11-25",
            "FTIME":"15:40~17:00",
            "FWEEK": "周一",
            "FBRAND": "第四节",
            "FBEGTIME": "15:40",
            "FENDTIME": "17:00",
            "FTEACH": "宋太祖",
            "FBILLSTATE": "已结束",
            "FSTATENAME": "正常"
            },],
        loading: false,
        visible: false,

        
      };
    },
    created() {
    },
    mounted() { },
    methods: {
      //
      init(FBILLNO) {
        this.dataForm.FBILLNO = FBILLNO;
        if (this.dataForm.FBILLNO) {
          this.title = "查看详情"
          this.insertorupdate = false;
        }
        else {
          this.title = "新增"
          this.dataForm.FBILLNO = "K" + Math.floor(Math.random() * 10000000) + 1;
          this.insertorupdate = true;
        }
        this.visible = true;
      },
      insert() {
        this.$refs.StudqueryFcuston.open();
      },
      shoplist(data) {
        data.forEach(item => {
          this.list.push({
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "1"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "曹操"
          },{
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "2"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "刘备"
          })
        });
      },
      //
      cancel() {
        this.$refs.elForm.resetFields();
        this.list = [];
        this.visible = false;
      },
    },
  };
</script>